home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / ProcDoggie 1.0a6 / UMenuHandler.p < prev    next >
Encoding:
Text File  |  1991-02-07  |  3.9 KB  |  131 lines  |  [TEXT/MPS ]

  1. UNIT UMenuHandler;
  2.  
  3. {-------------------------------------------------------------------------------
  4. #
  5. #    Apple Macintosh Developer Technical Support
  6. #
  7. #    Interfaces for the menu-handling routines
  8. #
  9. #    Program:    ProcDoggie
  10. #    File:        UMenuHandler.p - Pascal Implementation
  11. #
  12. #    by:        Forrest Tanaka
  13. #
  14. #    Copyright © 1988-1991 Apple Computer, Inc.
  15. #    All rights reserved.
  16. #
  17. --------------------------------------------------------------------------------
  18. #
  19. #    All of the code in this module is used to maintain the menus and to handle
  20. #    menu selections by the user.
  21. #
  22. -------------------------------------------------------------------------------}
  23. {[j=20/57/1$] Pasmat Options}
  24.  
  25.  
  26. INTERFACE
  27.  
  28.  
  29. (*******************************************************************************
  30. * Used Units
  31. *******************************************************************************)
  32.  
  33.     USES
  34.         (* Group 1 *)
  35.          Types
  36.         ,QuickDraw
  37.  
  38.         (* Group 2 *)
  39.         ,Controls
  40.         ,Errors
  41.         ,Events
  42.         ,Memory
  43.         ,Menus
  44.         ,Resources
  45.         ,SegLoad
  46.         ,TextEdit
  47.         ,ToolUtils
  48.  
  49.         (* Group 3 *)
  50.         ,Desk
  51.         ,Processes
  52.         ,Windows
  53.  
  54.         (* Group 4 *)
  55.         ,Dialogs
  56.  
  57.         (* Application *)
  58.         ,UGlobals
  59.         ,UProcessUtils
  60.         ,UProcessGuts
  61.         ;
  62.  
  63.  
  64. (*******************************************************************************
  65. * Constants
  66. *******************************************************************************)
  67.  
  68.     CONST
  69.         mApple = 128; {Menu ID and resource ID of Apple menu}
  70.         iAbout = 1;   {Menu item number of About SevenPaint item}
  71.  
  72.         mFile        = 129; {Menu ID and resource ID of File menu}
  73.         iLaunchFore  = 1;   {Menu item number of Launch to Foreground… item}
  74.         iLaunchBack  = 2;   {Menu item number of Launch to Background… item}
  75.         iLaunchTo    = 3;   {Menu item number of Launch To… item}
  76.         iJustLaunch  = 5;   {Menu item number of Simple Launch item}
  77.         iOpenLaunch  = 6;   {Menu item number of Open Documents on Launch item}
  78.         iPrintLaunch = 7;   {Menu item number of Print Documents on Launch item}
  79.         iQuit        = 9;   {Menu item number of Quit item}
  80.  
  81.         mProcess          = 130; {Menu ID and resource ID of Process menu}
  82.         iBringFront       = 1;   {Menu item number of Bring Process to Front item}
  83.         iShowProcessInfo  = 2;   {Menu item number of Show Process Info item}
  84.         iTerminateProcess = 3;   {Menu item number of Terminate Process item}
  85.  
  86.  
  87. (*******************************************************************************
  88. * StartMenus - Do additional initialization of the menus
  89. *
  90. * This routine is called just after calling the Utilities sample code routine,
  91. * StandardMenuSetup.  This application needs to do just a little bit of
  92. * additional initialization for menus.  See UMenuHandler.inc1.p for details.
  93. *
  94. * If there isn’t enough memory to load the menus, then the gError global is set
  95. * to memFullErr.  If desired menu resources couldn’t be found, then gError is
  96. * set to resNotFound.  If any other error occurs, then gError is set to
  97. * dsSysErr.
  98. *******************************************************************************)
  99.  
  100.     PROCEDURE StartMenus;
  101.  
  102.  
  103. (*******************************************************************************
  104. * DoMenuChoice - Dispatch to the appropriate routine for a menu choice
  105. *
  106. * When it’s determined that a menu item was chosen, this routine is called to
  107. * dispatch to the appropriate routine for the chosen menu item.  The menu item
  108. * and menu number returned by MenuSelect and MenuKey is passed in the menuChoice
  109. * parameter.
  110. *******************************************************************************)
  111.  
  112.     PROCEDURE DoMenuChoice (menuChoice: LongInt);
  113.  
  114.  
  115. (*******************************************************************************
  116. * FixMenus - Fix menus so that proper items are enabled and marked
  117. *
  118. * FixMenus is called to assure that menu items are disable, enabled, marked, and
  119. * unmarked appropriately.  It’s called at the end of every iteration of the main
  120. * event loop.
  121. *******************************************************************************)
  122.  
  123.     PROCEDURE FixMenus;
  124.  
  125.  
  126. IMPLEMENTATION
  127.  
  128.     {$I UMenuHandler.inc1.p}
  129.  
  130. END.
  131.